/**
 * 获取树形结构所有id
 * @param treeList 树形结构列表
 * @returns 树形结构所有id
 */
export function getTreeAllIds(treeList: any[]): string[] {
  function getTreeIds(children: any[]) {
    const menuIds: string[] = []
    children.forEach((item) => {
      menuIds.push(item.id)
      if (item.children && item.children.length > 0) {
        menuIds.push(...getTreeIds(item.children))
      }
    })
    return menuIds
  }
  return getTreeIds(treeList)
}
